import axios from 'axios'

const service = axios.create({
  baseURL: 'http://localhost:3000',
  timeout: 6000,
  headers: {
    "content-type": "application/json;charset=utf-8",
    token: ''
  }
})

// 请求拦截
service.interceptors.request.use(
  function (config) {
    config.headers = {
      token: '123'
    }
    return config
  },
  function (error) {
    // 对请求错误做些什么
    console.log(error)
    return Promise.reject(error)
  }
)

export default service